﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Comdiv.QWeb.Test.Configuraiton {
    [TestFixture]
    public class ignorecase_factory_test {
        [Render("sample")]
        public class sampleRender : IRender {
            public bool NeedResult {
                get { return false; }
            }

            public void Render(QWebContext context) {
                context.Output.Write("sample");
            }

            public void RenderError(Exception error, QWebContext context) {
                throw new NotImplementedException();
            }
        }

        [Action("Abc.Abc")]
        public class sampleAction : ActionBase {
            protected override object process() {
                return true;
            }
        }

        [Test]
        public void Abc_Abc_test() {
            TextWriter sw = new StringWriter();
            var result = new QWebHandler().ProcessRequest(new QWebContext("http://localhost/Abc/Abc.sample.qweb") { Output = sw });
            Assert.AreEqual("sample", sw.ToString());
        }

        [Test]
        public void abc_Abc_test() {
            TextWriter sw = new StringWriter();
            var result = new QWebHandler().ProcessRequest(new QWebContext("http://localhost/abc/Abc.sample.qweb") { Output = sw });
            Assert.AreEqual("sample", sw.ToString());
        }

        [Test]
        public void abc_abc_test() {
            TextWriter sw = new StringWriter();
            var result = new QWebHandler().ProcessRequest(new QWebContext("http://localhost/abc/abc.sample.qweb") { Output = sw });
            Assert.AreEqual("sample", sw.ToString());
        }
    }
}
